
local CommonOHOH = _G.CommonOHOH;
local M = CommonOHOH.class.new(script, script.Parent.base,script.Parent.Name);

function M.new(self,...)
	return M(self,...);
end;

function M.ctor(self, parent)
	M.super.ctor(self, parent);
	self.DataBase=self.parent:GetComponent(_G.ClientOHOH.load.Client_PlayerDataComponent())

	self:InitData()

	     
    self.player.UserDataEvent:Connect(function(key)
        if key=="base" then

			local oldBaseRollSpeed=self.BaseRollSpeed or 0
			local oldBaseLucky=self.BaseLucky or 0
			local oldBaseShinyLucky=self.BaseShinyLucky or 0
			local oldBaseRainbowLucky=self.BaseRainbowLucky or 0
			local oldBaseVoidLucky=self.BaseVoidLucky or 0


			self:UpdateBase()

			if oldBaseRollSpeed==self.BaseRollSpeed and oldBaseLucky==self.BaseLucky and oldBaseShinyLucky==self.BaseShinyLucky and oldBaseRainbowLucky==self.BaseRainbowLucky and oldBaseVoidLucky and self.BaseVoidLucky then
				return 
			end

			self.UpdateEvent:Action()
        end
    end);

end;



function M.dtor(self)
	M.super.dtor(self);
end;



return M
